@extends('admin.layout')
@section('content')
<div class="col-md-12 col-sm-12 col-xs-12">
    <div class="panel panel-info">
        <ol class="breadcrumb">
            <li>栏目管理</li>
            <li><a href="/admin/column">栏目列表</a></li>
            <li class="active">栏目添加</li>
        </ol>
        <div class="panel-heading">
            @if (count($errors) > 0)
                <div class="mws-form-message error">
                    出错啦!!!
                    <ul>
                        @foreach ($errors->all() as $error)
                        <li>{{$error}}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
            @if(session('success') == 1)
                <div class="mws-form-message info">
                    操作成功!!!
                </div>
            @endif
            @if(session('error') == 1)
                <div class="mws-form-message error">
                    操作失败!!!
                </div>
            @endif
        </div>
        <div class="panel-body" style="width: 80%;">
            <form role="form" action="/admin/topic" method="post" enctype="multipart/form-data">
                <div class="form-group">
                    <label>话题名</label>
                    <input class="form-control" type="text" name="title">
                </div>
                <div class="form-group">
                    <label>话题描述</label>
                    <input class="form-control" type="text" name="desc">
                </div>
                <div class="form-group">
                    <label>所属栏目</label>
                    <select class="form-control" name="column">
                        @foreach($columns as $k=>$v)
                        <option value="{{$v->id}}">{{$v->title}}</option>
                        @endforeach
                    </select>
                </div>
                <div class="form-group">
                    <label>话题logo</label>
                    <div class="fileupload fileupload-new">
                        <label>
                            <span class="btn btn-file btn-default">
                                <input name="pic" type="file">
                            </span>
                        </label>
                    </div>
                </div>
                {{csrf_field()}}
                <button type="submit" class="btn btn-info">添加</button>
                <button type="reset" class="btn btn-danger">重置</button>
            </form>
        </div>
    </div>
</div>
<!-- <div class="clearfix"> </div> -->
@endsection